#include <stdio.h>
#include <string.h>
#include <stdlib.h>

struct Person
{
    char name[64];
    int age;
    int ID;
    double score;
};

//规避地址传递的副作用(在使用对象指针的情况下,有可能意外修改了原数据)
void printPerson(const struct Person *person)
{
    //person->ID =128;

    //故意要修改
    //struct Person *p = (struct Person *)person;
    //p->ID = 128;

    printf("Name:%s Age:%d ID:%d Score:%f\n", person->name, person->age, person->ID, person->score);
}

void test()
{
    struct Person person = {"Trump", 30, 256, 59.9};
    printPerson(&person);
}

int main(int argc, char const *argv[])
{
    test();
    return 0;
}
